<template>
  <div style="width: auto;height: 400px" ref="a">
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: "echarts",
  data() {
    return {}
  },
  mounted() {
    this.echartsInit()
  },
  methods:{
    echartsInit() {
      echarts.init(this.$refs.a).setOption({
        title: {
          text: '圆环图的例子',
          left: 'center',
          top: 'center'
        },
        series: [
          {
            type: 'pie',
            data: [
              {
                value: 335,
                name: 'A'
              },
              {
                value: 234,
                name: 'B'
              },
              {
                value: 1548,
                name: 'C'
              }
            ],
            radius: ['40%', '70%']
          }
        ]




      })
    }
  }
}
</script>

<style scoped>

</style>
